package com.doit.day01;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class _03_java连接redis客户端 {
    public static void main(String[] args) {
        //导一个依赖
        //第一种连接方式
        Jedis jedis = new Jedis("linux01", 6379);
        String ping = jedis.ping();
        System.out.println(ping);


        JedisPool jedisPool = new JedisPool("linux01", 6379);
        Jedis jedis1 = jedisPool.getResource();
        String ping1 = jedis1.ping();
        System.out.println(ping1);

        //要set 一个字符串导redis中去
        jedis.setex("phone",60,"765567");

    }
}
